package com.map;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

@SuppressWarnings({"all"})
public class mapTest_1 {
    public static void main(String[] args) {
        Map map = new HashMap();
        map.put("李白",666);
        map.put("韩信",1);
        map.put("卫庄",2);
        map.put("盖聂",3);
        map.put("少雨",4);
        map.put("盖聂",8);
        map.put("剑圣",3);
        System.out.println(map.get("李白"));
//        System.out.println(map);
        map.remove("韩信");
//        System.out.println(map);
        //1.取key
        Set keyset=map.keySet();
        for(Object key:keyset){
            System.out.println(key);
        }
        Iterator iterator=keyset.iterator();
        while (iterator.hasNext()) {
            Object next =  iterator.next();
            System.out.println(next);

        }

    }
}
